<script lang="tsx" setup>
import PageHeader from '../../components/page-header.vue';
import CommonPage from './components/common-page.vue';
import { HbSubjectEnum } from '../../apis';

interface Props {
  tabs: Record<string, any>;
}

const { tabs } = defineProps<Props>();

const modulesMap = new Map<string, any>([
  ['重点排污单位', HbSubjectEnum.KEYSEWAGE],
  ['重点用能单位', HbSubjectEnum.ENERGYCONSUMPTION],
  ['清洁生产企业', HbSubjectEnum.CLEANERPRODUCTION],
  ['碳配额管理单位', HbSubjectEnum.CARBONEMISSION]
]);
</script>

<template>
  <page-header :title="tabs.name" :menuId="tabs.id" />
  <template v-for="(item, index) in tabs.functions" :key="index">
    <common-page v-if="item.status === 0 && modulesMap.get(item.name)" :hbSubjectType="modulesMap.get(item.name)" :menuId="item.id" :count="item.count" :title="item.name" />
  </template>
</template>

